<template>
  <div>
    <h1>权限列表</h1>
    <el-table :data="rightsList" border style="width: 100%">
      <el-table-column type="index"> </el-table-column>
      <el-table-column prop="authName" label="权限名称"> </el-table-column>
      <el-table-column prop="path" label="路径"> </el-table-column>
      <el-table-column label="等级">
        <template slot-scope="scope">
          <el-button type="primary" v-if="scope.row.level == 0" plain
            >一级</el-button
          >
          <el-button type="success" v-if="scope.row.level == 1" plain
            >二级</el-button
          >
          <el-button type="danger" v-if="scope.row.level == 2" plain
            >三级</el-button
          >
        </template>
      </el-table-column>
    </el-table>
  </div>
</template>

<script>
export default {
  data() {
    return {
      rightsList: [],
    };
  },
  methods: {
    getRightsList() {
      this.$axios.get("rights/list").then((res) => {
        console.log(res);
        this.rightsList = res.data.data;
      });
    },
  },
  created() {
    this.getRightsList();
  },
  mounted() {},
  components: {},
  computed: {},
  watch: {},
};
</script>

<style lang="scss" scoped></style>
